import 'package:flutter/material.dart';
import 'package:sharing/resources/styles.dart';
import 'package:sharing/resources/code_point.dart';
import 'package:sharing/resources/font_families.dart';

class MyContent extends StatefulWidget {
  @override
  _MyContentState createState() => _MyContentState();
}

class _MyContentState extends State<MyContent> {
  @override
  Widget build(BuildContext context) {
    return SizedBox(
      height: 200,
      child: Container(
        margin: const EdgeInsets.all(8.0),
        decoration: BoxDecoration(
          //  color: Colors.indigo,
          color: Colors.black38,
          borderRadius: BorderRadius.circular(8.0),
        ),
        child: Stack(
          fit: StackFit.expand,
          children: <Widget>[
            Positioned(
              top: 16,
              right: 16,
              child: GestureDetector(
                child: Container(
                  child: Icon(
                    IconData(IconCode.message,
                        fontFamily: FontFamiles.iconFontFamily),
                    size: 32,
                    color: Colors.white,
                  ),
                ),
                onTap: () {
                  Scaffold.of(context).showSnackBar(SnackBar(
                    content: Container(
                      child: Text("this this content show nessage"),
                    ),
                    duration: Duration(seconds: 3),
                  ));
                },
              ),
            ),
            Center(
              child: Container(
                height: 96,
                width: 96,
                child: CircleAvatar(
                  radius: 48,
                  backgroundImage: NetworkImage(
                      "https://avatars1.githubusercontent.com/u/46526052?s=400&u=b0f64fc2f67c45c17341d0090120d1e23f6b6478&v=4"),
                ),
              ),
            ),
            Positioned(
              left: 0.0,
              bottom: 0,
              right: 0.0,
              height: 56.0,
              child: SizedBox(
                height: 56,
                child: Container(
                  alignment: Alignment.center,
                  //  height: 0,
                  // color: Colors.indigo,
                  padding: const EdgeInsets.symmetric(
                      horizontal: 8.0, vertical: 4.0),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: <Widget>[
                      Container(
                        height: 48,
                        padding: const EdgeInsets.only(right: 8.0),
                        child: Column(
                          children: <Widget>[
                            Text(
                              "1",
                              style: AppStyles.contextTextStyle,
                            ),
                            Text(
                              "关注",
                              style: AppStyles.contextTextStyle,
                            )
                          ],
                        ),
                      ),
                      Container(
                        padding: const EdgeInsets.only(
                            left: 4, top: 8, bottom: 16, right: 4.0),
                        child: Text(
                          "|",
                          style: TextStyle(
                              color: Colors.white,
                              fontSize: 24,
                              fontWeight: FontWeight.normal),
                        ),
                      ),

                      Container(
                        height: 48,
                        padding: const EdgeInsets.only(right: 8.0, left: 8),
                        child: Column(
                          children: <Widget>[
                            Text("233", style: AppStyles.contextTextStyle),
                            Text("粉丝", style: AppStyles.contextTextStyle)
                          ],
                        ),
                      ),

                      Expanded(
                        child: Container(),
                      ),
//                     Container(
//                       child: Row(
//                         crossAxisAlignment: CrossAxisAlignment.center,
//                         mainAxisAlignment: MainAxisAlignment.spaceBetween,
//                         children: <Widget>[
//                           Text("关注"),
//                           SizedBox(width: 12,),
//                           Text("粉丝"),
//                         ],
//                       ),
//                     ),

                      Container(
                        child: Text("编辑资料"),
                      ),
                    ],
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
